﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
namespace GSLMS.Entity
{
	/// <summary>
	/// 2.3.55    贷款收回信息表
	/// </summary>
	[DataContract(IsReference = true)]
	public partial class TB_LOAN_RETURN: IObjectWithChangeTracker, INotifyPropertyChanged
	{
		public TB_LOAN_RETURN()
		{}
		#region Model
		private long _id;
		private long _proid;
		private long _conid;
		private long _loanid;
		private string _custname;
		private string _custno;
		private string _conno;
		private string _loanno;
		private string _applyno;
		private int _inttype;
		private decimal _tranamt;
		private decimal _disamt;
		private int _paymode;
		private string _exchangeno;
		private Nullable<DateTime> _paydate;
		private string _shouldphase;
		private decimal _shouldcapital;
		private decimal _shouldint;
		private decimal _shouldcost;
		private decimal _shouldfees;
		private decimal _shoulddelayint;
		private decimal _shoulddelayamt;
		private decimal _totalshould;
		private decimal _redcapital;
		private decimal _redint;
		private decimal _redcost;
		private decimal _redfees;
		private decimal _reddelayint;
		private decimal _reddelayamt;
		private decimal _totalred;
		private decimal _actcapital;
		private decimal _actint;
		private decimal _actcost;
		private decimal _actfees;
		private decimal _actdelayint;
		private decimal _actdelayamt;
		private decimal _totalact;
		private int _status;
		private string _createby;
		private Nullable<DateTime> _createdate;
		private string _confrimby;
		private Nullable<DateTime> _confirmdate;
		private string _actionby;
		private Nullable<DateTime> _actiondate;
		private long _accountid;
		private string _accountname;
		private string _remark;
		/// <summary>
		/// 记录ID唯一
		/// </summary>
		[DataMember]
		public long ID
		{
			get{return _id;}
			set{
				if ( _id!= value)
				{
					if (ChangeTracker.ChangeTrackingEnabled && ChangeTracker.State != ObjectState.Added)
					{
						throw new InvalidOperationException("属性“ID”是对象键的一部分，不可更改。仅当未跟踪对象或对象处于“已添加”状态时，才能对键属性进行更改。");
					}
					 _id = value;
					OnPropertyChanged("ID");
				}
			}
		}
		/// <summary>
		/// 立项申请记录ID
		/// </summary>
		[DataMember]
		public long PROID
		{
			get{return _proid;}
			set{
				if ( _proid!= value)
				{
					 _proid = value;
					OnPropertyChanged("PROID");
				}
			}
		}
		/// <summary>
		/// 合同记录ID
		/// </summary>
		[DataMember]
		public long CONID
		{
			get{return _conid;}
			set{
				if ( _conid!= value)
				{
					 _conid = value;
					OnPropertyChanged("CONID");
				}
			}
		}
		/// <summary>
		/// 放款记录ID
		/// </summary>
		[DataMember]
		public long LOANID
		{
			get{return _loanid;}
			set{
				if ( _loanid!= value)
				{
					 _loanid = value;
					OnPropertyChanged("LOANID");
				}
			}
		}
		/// <summary>
		/// 客户名称
		/// </summary>
		[DataMember]
		public string CUSTNAME
		{
			get{return _custname;}
			set{
				if ( _custname!= value)
				{
					 _custname = value;
					OnPropertyChanged("CUSTNAME");
				}
			}
		}
		/// <summary>
		/// 证件号码
		/// </summary>
		[DataMember]
		public string CUSTNO
		{
			get{return _custno;}
			set{
				if ( _custno!= value)
				{
					 _custno = value;
					OnPropertyChanged("CUSTNO");
				}
			}
		}
		/// <summary>
		/// 合同编号
		/// </summary>
		[DataMember]
		public string CONNO
		{
			get{return _conno;}
			set{
				if ( _conno!= value)
				{
					 _conno = value;
					OnPropertyChanged("CONNO");
				}
			}
		}
		/// <summary>
		/// 贷款号
		/// </summary>
		[DataMember]
		public string LOANNO
		{
			get{return _loanno;}
			set{
				if ( _loanno!= value)
				{
					 _loanno = value;
					OnPropertyChanged("LOANNO");
				}
			}
		}
		/// <summary>
		/// 申请编号
		/// </summary>
		[DataMember]
		public string APPLYNO
		{
			get{return _applyno;}
			set{
				if ( _applyno!= value)
				{
					 _applyno = value;
					OnPropertyChanged("APPLYNO");
				}
			}
		}
		/// <summary>
		/// 计息种类1正常应还，2提前结清
		/// </summary>
		[DataMember]
		public int INTTYPE
		{
			get{return _inttype;}
			set{
				if ( _inttype!= value)
				{
					 _inttype = value;
					OnPropertyChanged("INTTYPE");
				}
			}
		}
		/// <summary>
		/// 收款金额
		/// </summary>
		[DataMember]
		public decimal TRANAMT
		{
			get{return _tranamt;}
			set{
				if ( _tranamt!= value)
				{
					 _tranamt = value;
					OnPropertyChanged("TRANAMT");
				}
			}
		}
		/// <summary>
		/// 抵扣合计
		/// </summary>
		[DataMember]
		public decimal DISAMT
		{
			get{return _disamt;}
			set{
				if ( _disamt!= value)
				{
					 _disamt = value;
					OnPropertyChanged("DISAMT");
				}
			}
		}
		/// <summary>
		/// 交易方式
		/// </summary>
		[DataMember]
		public int PAYMODE
		{
			get{return _paymode;}
			set{
				if ( _paymode!= value)
				{
					 _paymode = value;
					OnPropertyChanged("PAYMODE");
				}
			}
		}
		/// <summary>
		/// 水单号
		/// </summary>
		[DataMember]
		public string EXCHANGENO
		{
			get{return _exchangeno;}
			set{
				if ( _exchangeno!= value)
				{
					 _exchangeno = value;
					OnPropertyChanged("EXCHANGENO");
				}
			}
		}
		/// <summary>
		/// 还款日期通过所落入的计息期间来获取应还的期数
		/// </summary>
		[DataMember]
		public Nullable<DateTime> PAYDATE
		{
			get{return _paydate;}
			set{
				if ( _paydate!= value)
				{
					 _paydate = value;
					OnPropertyChanged("PAYDATE");
				}
			}
		}
		/// <summary>
		/// 应还期数
		/// </summary>
		[DataMember]
		public string SHOULDPHASE
		{
			get{return _shouldphase;}
			set{
				if ( _shouldphase!= value)
				{
					 _shouldphase = value;
					OnPropertyChanged("SHOULDPHASE");
				}
			}
		}
		/// <summary>
		/// 应还本金
		/// </summary>
		[DataMember]
		public decimal SHOULDCAPITAL
		{
			get{return _shouldcapital;}
			set{
				if ( _shouldcapital!= value)
				{
					 _shouldcapital = value;
					OnPropertyChanged("SHOULDCAPITAL");
				}
			}
		}
		/// <summary>
		/// 应还利息
		/// </summary>
		[DataMember]
		public decimal SHOULDINT
		{
			get{return _shouldint;}
			set{
				if ( _shouldint!= value)
				{
					 _shouldint = value;
					OnPropertyChanged("SHOULDINT");
				}
			}
		}
		/// <summary>
		/// 应还管理费
		/// </summary>
		[DataMember]
		public decimal SHOULDCOST
		{
			get{return _shouldcost;}
			set{
				if ( _shouldcost!= value)
				{
					 _shouldcost = value;
					OnPropertyChanged("SHOULDCOST");
				}
			}
		}
		/// <summary>
		/// 应还手续费
		/// </summary>
		[DataMember]
		public decimal SHOULDFEES
		{
			get{return _shouldfees;}
			set{
				if ( _shouldfees!= value)
				{
					 _shouldfees = value;
					OnPropertyChanged("SHOULDFEES");
				}
			}
		}
		/// <summary>
		/// 应还逾期利息
		/// </summary>
		[DataMember]
		public decimal SHOULDDELAYINT
		{
			get{return _shoulddelayint;}
			set{
				if ( _shoulddelayint!= value)
				{
					 _shoulddelayint = value;
					OnPropertyChanged("SHOULDDELAYINT");
				}
			}
		}
		/// <summary>
		/// 应还违约金
		/// </summary>
		[DataMember]
		public decimal SHOULDDELAYAMT
		{
			get{return _shoulddelayamt;}
			set{
				if ( _shoulddelayamt!= value)
				{
					 _shoulddelayamt = value;
					OnPropertyChanged("SHOULDDELAYAMT");
				}
			}
		}
		/// <summary>
		/// 应还合计
		/// </summary>
		[DataMember]
		public decimal TOTALSHOULD
		{
			get{return _totalshould;}
			set{
				if ( _totalshould!= value)
				{
					 _totalshould = value;
					OnPropertyChanged("TOTALSHOULD");
				}
			}
		}
		/// <summary>
		/// 减免本金
		/// </summary>
		[DataMember]
		public decimal REDCAPITAL
		{
			get{return _redcapital;}
			set{
				if ( _redcapital!= value)
				{
					 _redcapital = value;
					OnPropertyChanged("REDCAPITAL");
				}
			}
		}
		/// <summary>
		/// 减免利息
		/// </summary>
		[DataMember]
		public decimal REDINT
		{
			get{return _redint;}
			set{
				if ( _redint!= value)
				{
					 _redint = value;
					OnPropertyChanged("REDINT");
				}
			}
		}
		/// <summary>
		/// 减免管理费
		/// </summary>
		[DataMember]
		public decimal REDCOST
		{
			get{return _redcost;}
			set{
				if ( _redcost!= value)
				{
					 _redcost = value;
					OnPropertyChanged("REDCOST");
				}
			}
		}
		/// <summary>
		/// 减免手续费
		/// </summary>
		[DataMember]
		public decimal REDFEES
		{
			get{return _redfees;}
			set{
				if ( _redfees!= value)
				{
					 _redfees = value;
					OnPropertyChanged("REDFEES");
				}
			}
		}
		/// <summary>
		/// 减免逾期利息
		/// </summary>
		[DataMember]
		public decimal REDDELAYINT
		{
			get{return _reddelayint;}
			set{
				if ( _reddelayint!= value)
				{
					 _reddelayint = value;
					OnPropertyChanged("REDDELAYINT");
				}
			}
		}
		/// <summary>
		/// 减免违约金
		/// </summary>
		[DataMember]
		public decimal REDDELAYAMT
		{
			get{return _reddelayamt;}
			set{
				if ( _reddelayamt!= value)
				{
					 _reddelayamt = value;
					OnPropertyChanged("REDDELAYAMT");
				}
			}
		}
		/// <summary>
		/// 减免合计
		/// </summary>
		[DataMember]
		public decimal TOTALRED
		{
			get{return _totalred;}
			set{
				if ( _totalred!= value)
				{
					 _totalred = value;
					OnPropertyChanged("TOTALRED");
				}
			}
		}
		/// <summary>
		/// 实还本金
		/// </summary>
		[DataMember]
		public decimal ACTCAPITAL
		{
			get{return _actcapital;}
			set{
				if ( _actcapital!= value)
				{
					 _actcapital = value;
					OnPropertyChanged("ACTCAPITAL");
				}
			}
		}
		/// <summary>
		/// 实还利息
		/// </summary>
		[DataMember]
		public decimal ACTINT
		{
			get{return _actint;}
			set{
				if ( _actint!= value)
				{
					 _actint = value;
					OnPropertyChanged("ACTINT");
				}
			}
		}
		/// <summary>
		/// 实还管理费
		/// </summary>
		[DataMember]
		public decimal ACTCOST
		{
			get{return _actcost;}
			set{
				if ( _actcost!= value)
				{
					 _actcost = value;
					OnPropertyChanged("ACTCOST");
				}
			}
		}
		/// <summary>
		/// 实还手续费
		/// </summary>
		[DataMember]
		public decimal ACTFEES
		{
			get{return _actfees;}
			set{
				if ( _actfees!= value)
				{
					 _actfees = value;
					OnPropertyChanged("ACTFEES");
				}
			}
		}
		/// <summary>
		/// 实还逾期利息
		/// </summary>
		[DataMember]
		public decimal ACTDELAYINT
		{
			get{return _actdelayint;}
			set{
				if ( _actdelayint!= value)
				{
					 _actdelayint = value;
					OnPropertyChanged("ACTDELAYINT");
				}
			}
		}
		/// <summary>
		/// 实还违约金
		/// </summary>
		[DataMember]
		public decimal ACTDELAYAMT
		{
			get{return _actdelayamt;}
			set{
				if ( _actdelayamt!= value)
				{
					 _actdelayamt = value;
					OnPropertyChanged("ACTDELAYAMT");
				}
			}
		}
		/// <summary>
		/// 实还合计
		/// </summary>
		[DataMember]
		public decimal TOTALACT
		{
			get{return _totalact;}
			set{
				if ( _totalact!= value)
				{
					 _totalact = value;
					OnPropertyChanged("TOTALACT");
				}
			}
		}
		/// <summary>
		/// 状态0保存，1确认，2收回成功，3收回失败
		/// </summary>
		[DataMember]
		public int STATUS
		{
			get{return _status;}
			set{
				if ( _status!= value)
				{
					 _status = value;
					OnPropertyChanged("STATUS");
				}
			}
		}
		/// <summary>
		/// 建档人
		/// </summary>
		[DataMember]
		public string CREATEBY
		{
			get{return _createby;}
			set{
				if ( _createby!= value)
				{
					 _createby = value;
					OnPropertyChanged("CREATEBY");
				}
			}
		}
		/// <summary>
		/// 建档时间
		/// </summary>
		[DataMember]
		public Nullable<DateTime> CREATEDATE
		{
			get{return _createdate;}
			set{
				if ( _createdate!= value)
				{
					 _createdate = value;
					OnPropertyChanged("CREATEDATE");
				}
			}
		}
		/// <summary>
		/// 确认人
		/// </summary>
		[DataMember]
		public string CONFRIMBY
		{
			get{return _confrimby;}
			set{
				if ( _confrimby!= value)
				{
					 _confrimby = value;
					OnPropertyChanged("CONFRIMBY");
				}
			}
		}
		/// <summary>
		/// 确认时间
		/// </summary>
		[DataMember]
		public Nullable<DateTime> CONFIRMDATE
		{
			get{return _confirmdate;}
			set{
				if ( _confirmdate!= value)
				{
					 _confirmdate = value;
					OnPropertyChanged("CONFIRMDATE");
				}
			}
		}
		/// <summary>
		/// 处理人当状态为2,3时记录
		/// </summary>
		[DataMember]
		public string ACTIONBY
		{
			get{return _actionby;}
			set{
				if ( _actionby!= value)
				{
					 _actionby = value;
					OnPropertyChanged("ACTIONBY");
				}
			}
		}
		/// <summary>
		/// 处理时间当状态为2,3时记录
		/// </summary>
		[DataMember]
		public Nullable<DateTime> ACTIONDATE
		{
			get{return _actiondate;}
			set{
				if ( _actiondate!= value)
				{
					 _actiondate = value;
					OnPropertyChanged("ACTIONDATE");
				}
			}
		}
		/// <summary>
		/// 公司账号记录ID
		/// </summary>
		[DataMember]
		public long ACCOUNTID
		{
			get{return _accountid;}
			set{
				if ( _accountid!= value)
				{
					 _accountid = value;
					OnPropertyChanged("ACCOUNTID");
				}
			}
		}
		/// <summary>
		/// 公司账号名称
		/// </summary>
		[DataMember]
		public string ACCOUNTNAME
		{
			get{return _accountname;}
			set{
				if ( _accountname!= value)
				{
					 _accountname = value;
					OnPropertyChanged("ACCOUNTNAME");
				}
			}
		}
		/// <summary>
		/// 备注
		/// </summary>
		[DataMember]
		public string REMARK
		{
			get{return _remark;}
			set{
				if ( _remark!= value)
				{
					 _remark = value;
					OnPropertyChanged("REMARK");
				}
			}
		}
		#endregion Model

	#region ChangeTracking
	   
	protected virtual void OnPropertyChanged(String propertyName)
	{
	    if (ChangeTracker.State != ObjectState.Added && ChangeTracker.State != ObjectState.Deleted)
	    {
	        ChangeTracker.State = ObjectState.Modified;
	    }
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	protected virtual void OnNavigationPropertyChanged(String propertyName)
	{
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged{ add { _propertyChanged += value; } remove { _propertyChanged -= value; } }
	private event PropertyChangedEventHandler _propertyChanged;
	private ObjectChangeTracker _changeTracker;
	   
	[DataMember]
	public ObjectChangeTracker ChangeTracker
	{
	    get
	    {
	        if (_changeTracker == null)
	        {
	            _changeTracker = new ObjectChangeTracker();
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	        return _changeTracker;
	    }
	    set
	    {
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging -= HandleObjectStateChanging;
	        }
	        _changeTracker = value;
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	    }
	}
	   
	private void HandleObjectStateChanging(object sender, ObjectStateChangingEventArgs e)
	{
	    if (e.NewState == ObjectState.Deleted)
	    {
	        ClearNavigationProperties();
	    }
	}
	   
	protected bool IsDeserializing { get; private set; }
	   
	[OnDeserializing]
	public void OnDeserializingMethod(StreamingContext context)
	{
	    IsDeserializing = true;
	}
	   
	[OnDeserialized]
	public void OnDeserializedMethod(StreamingContext context)
	{
	    IsDeserializing = false;
	    ChangeTracker.ChangeTrackingEnabled = true;
	}
	   
	protected virtual void ClearNavigationProperties()
	{
	}
	
	#endregion

	}
}

